/*
 * @Author: LIFM0623 1944099171@qq.com
 * @Date: 2024-02-26 21:34:20
 * @LastEditors: LIFM0623 1944099171@qq.com
 * @LastEditTime: 2024-02-26 21:36:46
 * @FilePath: \scene_back_nest\src\utils\CommonUtils.ts
 * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
 */
// 生成英文字母与数字的邀请码
export const generateRandomInviteCode = (length: number) => {
    const charset = '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ';
    let inviteCode = '';

    for (let i = 0; i < length; i++) {
        const randomIndex = Math.floor(Math.random() * charset.length);
        inviteCode += charset[randomIndex];
    }

    return inviteCode;
}